package com.machine.filling.function.main;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.machine.filling.base.IView;
import com.machine.filling.base.baseMvp.IBasePresenter;
import com.machine.filling.base.baseMvp.IBaseView;
import com.machine.filling.function.init.INextFragment;

/**
 * Created by Administrator on 2018/1/31 0031.
 * fragment内嵌套的fragment  基础fragment
 */

public abstract class BaseFgFragment<T extends IBasePresenter> extends Fragment implements IView,IBaseView<T> {
    public Activity mActivity;
    public Context mContext;
    public Intent mIntent;
    public T mPresenter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mActivity = getParentFragment().getActivity();
        mContext = getParentFragment().getContext();
        mIntent = mActivity.getIntent();

        View contentView = initViews();
        initDatas();
        return contentView;
    }


    @Override
    public void showProgress(String loadingStr) {

    }

    @Override
    public void hideProgress() {

    }

    @Override
    public void setPresenter(T presenter) {
        mPresenter = presenter;
    }

    protected INextFragment INextFragment;

    public void setINextFragment(INextFragment INextFragment) {
        this.INextFragment = INextFragment;
    }
}
